package com.systar.activity.events;

import java.nio.ByteBuffer;

import com.systar.activity.monitor.ActivitySource;

public interface IActivityEvent extends Cloneable
{
	/**
	 * @return a normalized type of event
	 */
	String getType();

	/**
	 * @return a message to display
	 */
	String getMessage();
	
	/**
	 * @return the source of the event
	 */
	ActivitySource getSource();
	
	/**
	 * Concatenate data with another event
	 * The 2 events must have same type to successfully concatenate
	 *   
	 * @param other the other event
	 */
	void concat(IActivityEvent other);

	/**
	 * @return a cloned event
	 */
    IActivityEvent clone();
    
	/**
	 * @return the serialization string for server
	 */
	String marshal();

	/**
	 * Modifies the serialization for ZooKeeper
	 * @param data the serialization data
	 */
	void marshal(ByteBuffer data);
}
